home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / interface / NewUserDlg.cpp < prev    next >
C/C++ Source or Header  |  2011-11-06  |  3KB  |  93 lines

  1. // FileZilla Server - a Windows ftp server
  2.  
  3. // Copyright (C) 2002-2004 - Tim Kosse <tim.kosse@gmx.de>
  4.  
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9.  
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14.  
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. // NewUserDlg.cpp: Implementierungsdatei
  20. //
  21.  
  22. #include "stdafx.h"
  23. #include "filezilla server.h"
  24. #include "NewUserDlg.h"
  25.  
  26. #if defined(_DEBUG) && !defined(MMGR)
  27. #define new DEBUG_NEW
  28. #undef THIS_FILE
  29. static char THIS_FILE[] = __FILE__;
  30. #endif
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Dialogfeld CNewUserDlg 
  34.  
  35.  
  36. CNewUserDlg::CNewUserDlg(CWnd* pParent /*=NULL*/)
  37.     : CDialog(CNewUserDlg::IDD, pParent)
  38. {
  39.     //{{AFX_DATA_INIT(CNewUserDlg)
  40.     m_Name = _T("");
  41.     //}}AFX_DATA_INIT
  42. }
  43.  
  44.  
  45. void CNewUserDlg::DoDataExchange(CDataExchange* pDX)
  46. {
  47.     CDialog::DoDataExchange(pDX);
  48.     //{{AFX_DATA_MAP(CNewUserDlg)
  49.     DDX_Control(pDX, IDOK, m_cOkCtrl);
  50.     DDX_Control(pDX, IDC_NEWUSER_GROUP, m_cGroup);
  51.     DDX_Text(pDX, IDC_NEWUSER_NAME, m_Name);
  52.     //}}AFX_DATA_MAP
  53. }
  54.  
  55.  
  56. BEGIN_MESSAGE_MAP(CNewUserDlg, CDialog)
  57.     //{{AFX_MSG_MAP(CNewUserDlg)
  58.     ON_EN_CHANGE(IDC_NEWUSER_NAME, OnChangeNewuserName)
  59.     //}}AFX_MSG_MAP
  60. END_MESSAGE_MAP()
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // Behandlungsroutinen fⁿr Nachrichten CNewUserDlg 
  64.  
  65. void CNewUserDlg::OnChangeNewuserName() 
  66. {
  67.     //Disable the OK button if the edit field is empty
  68.     UpdateData(TRUE);
  69.     m_cOkCtrl.EnableWindow(m_Name != _T("") ? TRUE : FALSE);
  70. }
  71.  
  72. BOOL CNewUserDlg::OnInitDialog() 
  73. {
  74.     CDialog::OnInitDialog();
  75.     
  76.     m_cOkCtrl.EnableWindow(m_Name != _T("") ? TRUE : FALSE);    
  77.  
  78.     m_cGroup.AddString(_T("<none>"));
  79.     m_cGroup.SetCurSel(0);
  80.     for (std::list<CString>::iterator iter = m_GroupList.begin(); iter != m_GroupList.end(); iter++)
  81.         m_cGroup.AddString(*iter);
  82.     
  83.     return TRUE;  // return TRUE unless you set the focus to a control
  84.                   // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurⁿckgeben
  85. }
  86.  
  87. void CNewUserDlg::OnOK() 
  88. {
  89.     if (m_cGroup.GetCurSel() > 0)
  90.         m_cGroup.GetLBText(m_cGroup.GetCurSel(), m_Group);
  91.     CDialog::OnOK();
  92. }
  93.